<html>
<head>
	<meta charset="UTF-8">
	<title>普通用户登录处理页</title>
</head>
<body>
	<?php 
	require_once("./system/dbConn.php");
	connect();
	
	$username=trim($_POST['username']);
	$password=$_POST['password'];

	$sql="select * from users where uname='$username' and password=md5($password)";
	$result=mysql_query($sql) or die(mysql_error());
	$num=mysql_num_rows($result);
	// var_dump($sql);

	if ($num>0) {
		session_start();
		$_SESSION["uname"]=$username;
		echo "登陆成功";
		header("refresh:;url='index.php'");
	}
	else{
		echo "登录失败，请重新登录";
		header("refresh:1;url='index.php'");
	}
	
	 ?>
	
</body>
</html>